<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<link href="http://127.0.0.1/vancl/Static/Admin/css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="http://127.0.0.1/vancl/Static/Admin/js/jquery.js"></script>		
		<script type="text/javascript">
			$(function(){
				$('input[name=sort_by_csort]').click(function(){
					$('form').submit();
				})
				
			})
		</script>
	</head>

	<body>
		<div class="place">
			<span>位置：</span>
			<ul class="placeul">
				<li><a href="#">商品管理</a></li>
				<li><a href="#">分类管理</a></li>
				<li><a href="#">分类列表</a></li>
			</ul>
		</div>

		<div class="rightinfo">
			<table class="tablelist">
				<thead>
					<tr>
						<th>分类ID</th>
						<th>分类名称</th>
						<th>所属类型</th>
						<th>排序</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					    <?php if(count($data) == 0){ ?>
						<tr>
							<td colspan="5" align="center">
								还没有分类数据，赶快<a href="<?php echo U('Add');?>" class="tablelink"> 添加 </a>吧
							</td>
						</tr>
					<?php }else{ ?>
						<?php foreach ($data as $k=>$v){?>
							<tr>
								<td><?php echo $v['cid'];?></td>
								<td><?php echo $v['_name'];?></td>
								<td><?php echo $v['tname'];?></td>
								<td><?php echo $v['csort'];?></td>
								<td>
									<a href="<?php echo U('Add',array('pid'=>$v['cid'],'tid'=>$v['tid']));?>" class="tablelink">添加子类</a>
									<a href="<?php echo U('Edit',array('cid'=>$v['cid']));?>" class="tablelink">修改</a>
									<a href="<?php echo U('Del',array('cid'=>$v['cid']));?>" class="tablelink" onclick="if (!confirm('确认要删除吗？')) return false;">删除</a>
								</td>
							</tr>
						<?php }?>
					<?php } ?>

				</tbody>
			</table>
			
			<form action="" method="post">
				<div class="pagin">
	    				<div class="message">
	    					<input type="checkbox" name="sort_by_csort" id="sort_by_csort"     <?php if($check==1){ ?>checked<?php } ?>  />
	    					<label for="sort_by_csort">按“排序”字段进行排序（降序排列）</label>
	    				</div>
	    			</div>
    			</form>

			<script type="text/javascript">
				$('.tablelist tbody tr:odd').addClass('odd');
			</script>

	</body>

</html>